home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / AEscriptTemplate.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  3.8 KB  |  135 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. //  Alias|Wavefront Script File
  19. //
  20. //  Creation Date:    July 27, 1998
  21. //  Author:            cdt
  22. //
  23. //  Procedure Name: 
  24. //    AEscriptTemplate
  25. //
  26. //  Description:
  27. //    Controls for script nodes.
  28. //
  29. //  Input Value:
  30. //    nodeName 
  31. //
  32. //  Output Value:
  33. //    None
  34. // 
  35.  
  36. global proc AEbeforeScriptFieldNew(string $attrName)
  37. {
  38.     global int $gTextColumnWidthIndex;
  39.     setUITemplate -pst attributeEditorTemplate;
  40.     formLayout beforeScriptForm;
  41.     text -l "Before" beforeScriptText;
  42.     textField -ed 0 beforeScriptField;
  43.     setParent ..;
  44.     formLayout -e
  45.         -aof beforeScriptText right (5 - $gTextColumnWidthIndex)
  46.         -af beforeScriptText top 0
  47.         -af beforeScriptText bottom 0
  48.         -an beforeScriptText left
  49.         -af beforeScriptField top 0
  50.         -af beforeScriptField bottom 0
  51.         -af beforeScriptField right 0
  52.         -ac beforeScriptField left 5 beforeScriptText
  53.         beforeScriptForm;
  54.  
  55.     setUITemplate -ppt;
  56.  
  57.     AEbeforeScriptFieldReplace($attrName);
  58. }
  59.  
  60. global proc AEafterScriptFieldNew(string $attrName)
  61. {
  62.     global int $gTextColumnWidthIndex;
  63.     setUITemplate -pst attributeEditorTemplate;
  64.     formLayout afterScriptForm;
  65.     text -l "After" afterScriptText;
  66.     textField -ed 0 afterScriptField;
  67.     setParent ..;
  68.     formLayout -e
  69.         -aof afterScriptText right (5 - $gTextColumnWidthIndex)
  70.         -af afterScriptText top 0
  71.         -af afterScriptText bottom 0
  72.         -an afterScriptText left
  73.         -af afterScriptField top 0
  74.         -af afterScriptField bottom 0
  75.         -af afterScriptField right 0
  76.         -ac afterScriptField left 5 afterScriptText
  77.         afterScriptForm;
  78.  
  79.     setUITemplate -ppt;
  80.  
  81.     AEafterScriptFieldReplace($attrName);
  82. }
  83.  
  84. global proc AEbeforeScriptFieldReplace(string $attrName)
  85. {
  86.     scriptJob     -rp -p beforeScriptField
  87.                 -attributeChange $attrName
  88.                 ("AEbeforeScriptFieldUpdate " + $attrName);
  89.     AEbeforeScriptFieldUpdate $attrName;
  90. }
  91.  
  92. global proc AEafterScriptFieldReplace(string $attrName)
  93. {
  94.     scriptJob     -rp -p afterScriptField
  95.                 -attributeChange $attrName
  96.                 ("AEafterScriptFieldUpdate " + $attrName);
  97.     AEafterScriptFieldUpdate $attrName;
  98. }
  99.  
  100. global proc AEbeforeScriptFieldUpdate(string $attrName)
  101. {
  102.     string $script = `getAttr $attrName`;
  103.     textField -e -tx $script beforeScriptField;
  104. }
  105.  
  106. global proc AEafterScriptFieldUpdate(string $attrName)
  107. {
  108.     string $script = `getAttr $attrName`;
  109.     textField -e -tx $script afterScriptField;
  110. }
  111.  
  112. global proc AEscriptTemplate(string $nodeName)
  113. {
  114.     editorTemplate -beginScrollLayout;
  115.         editorTemplate -beginLayout "Script Attributes" -collapse 0;
  116.             editorTemplate -addControl "scriptType";
  117.             editorTemplate -callCustom     "AEbeforeScriptFieldNew" 
  118.                                         "AEbeforeScriptFieldReplace"
  119.                                         "before";
  120.             editorTemplate -callCustom     "AEafterScriptFieldNew" 
  121.                                         "AEafterScriptFieldReplace"
  122.                                         "after";
  123.         editorTemplate -endLayout;
  124.  
  125.         AEdependNodeTemplate $nodeName;
  126.  
  127.         editorTemplate -suppress "after";
  128.         editorTemplate -suppress "before";
  129.  
  130.         editorTemplate -addExtraControls;
  131.  
  132.         editorTemplate -endLayout;
  133.     editorTemplate -endScrollLayout;
  134. }
  135.